﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using Htss.Platform.Data;

namespace DreamBox.DAL.Admin
{
    public class UserGroup
    {
        /// <summary>
        /// 删除用户组
        /// </summary>
        /// <param name="GID"></param>
        /// <returns></returns>
        public bool Delete(int GID)
        {
            DbAction action = new DbAction("dbox_UserGroup");
            action.SetFields("GID", GID, DbFieldType.Condition);
            return action.Delete();
        }
        /// <summary>
        /// 更新用户组
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public bool Update(DreamBox.Model.Admin.UserGroup m)
        {
            DbAction action = new DbAction("dbox_UserGroup");
            action.SetFields("GID", m.GID, DbFieldType.Condition);
            action.SetFields("GroupName", m.GroupName);
            action.SetFields("IsStatus", m.IsStatus);
            return action.Update();
        }
        /// <summary>
        /// 添加用户组
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public bool Add(DreamBox.Model.Admin.UserGroup m)
        {
            DbAction action = new DbAction("dbox_UserGroup");
            action.SetFields("GID",m.GID);
            action.SetFields("GroupName",m.GroupName);
            action.SetFields("GroupImg","");
            action.SetFields("Points",0);
            action.SetFields("IsStatus",m.IsStatus);
            return action.Insert();
        }
    }
}
